#include <iostream>
#include <thread>
#include <chrono>
#include "FpsCap.hpp"

using namespace std;

int main(int argc, char const *argv[])
{
    FpsCap fps_cap(5);

    thread([&](){
        while (1)
        {
            fps_cap.sample();
            this_thread::sleep_for(milliseconds(30));
        }
    }).detach();

    while (1)
    {
        this_thread::sleep_for(seconds(2));
        cout << "fps=" << fps_cap.get_fps() << endl;
    }
    
    return 0;
}
